package com.best.oasis.settlement.web.action.employee;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.flex.remoting.RemotingDestination;
import org.springframework.stereotype.Service;

import com.best.oasis.settlement.common.entity.employee.Employee;
import com.best.oasis.settlement.common.so.employee.EmployeeSO;
import com.best.oasis.settlement.common.vo.employee.EmployeeVO;
import com.best.oasis.settlement.service.employee.EmployeeService;
import com.best.oasis.settlement.util.page.BasePageSO;
import com.best.oasis.settlement.util.page.PageList;
import com.best.oasis.settlement.web.action.base.BaseActionImpl;

@RemotingDestination
@Service
public class EmployeeActionImpl extends BaseActionImpl<EmployeeVO, Employee> implements EmployeeAction {

	@Autowired
	private EmployeeService employeeService;
	
	public void afterConstruct() {
		super.setBaseService(employeeService);
	}
	
	public PageList<EmployeeVO> getPageList(EmployeeSO so){
		return employeeService.getPageList(so);
	}

	/**
	 * 我们希望的前端调用的是getPageList(EmployeeSO so)方法，但是由于前端在参数转换的过程中
	 * 将EmployeeSO转换为了BasePageSO，实际调用的是后端基类的getPageList(BasePageSO so)
	 * 方法，所以需要覆盖基类的方法。
	 */
	@Override
	public PageList<EmployeeVO> getPageList(BasePageSO so) {
		return getPageList((EmployeeSO)so);
	}
	
}
